{% extends 'layout.html' %}
{% load custom_filters %}
{% block title %}巡检结果列表{% endblock %}
{% block content %}
<div class="row">
    {% if result_list %}
    <div class="col">
        <table class="table table-striped">
            <thead>
                    <tr>
                        <th>换电站名称</th>
                        <th>监控通道名称</th>
                        <th>巡检请求</th>
                        <th>检测时间</th>
                        <th>检出结果</th>
                    </tr>
                </thead>
                <tbody>
                {% for result in result_list %}
                    <tr>
                        <td><a href="/ai_inspect/station/{{result.station_id}}">{{ result.station_name }}</a></td>
                        <td>{{ result.channel_name }}</td>
                        <td>{{ result.inspect_name }}</td>
                        <td>{{ result.timestamp|timestamp_to_string }}</td>
                        <td><a target="_blank" href="/ai_inspect/inspect_request/{{result.request_name}}">{{ result.target_type }}</a></td>
                    </tr>
                {% endfor %}
                </tbody>
        </table>
    </div>
    {% else %}
    <div class="col">
        <div class="alert alert-danger" role="alert">未检索到巡检结果</div>
    </div>
    {% endif %}
</div>
{% endblock %}